import { Button } from "antd";

const BtnItem = (props) => {
  const btnStyle = {
    height: '28px',
    borderRadius: '4px',
    border: '1px solid #cbcdd1',
    fontSize: '12px',
    fontWeight: 400,
    letterSpacing: '0px',
    color: '#333',
  }
  const { elType="button",  type="default", icon, text, placeholder, hide, wrapFunc, ...reset } = props;
  if(hide) {
    return null;
  }
  if(elType == 'button') {
    const el = <Button style={btnStyle} type={type} icon={icon} {...reset}>{text}</Button>;
    if(wrapFunc) {
      return wrapFunc(el);
    }
    return el;
  }
}

export default BtnItem;